package day_2022_9_to_12.Day;

/**
 * @author haomin
 * @date 2022/09/29 21:24
 **/
public class Day28_2_Num153_FindMin {
    // 二分查找
    class Solution {
        public int findMin(int[] nums) {
            int l = 0, r = nums.length-1, mid;
            while(l < r){
                mid = l + ((r-l)>>1);
                if(nums[mid] > nums[r]){
                    l = mid + 1;
                }else r = mid;
            }
            return nums[l];
        }
    }
}